package com.power.project.model;


import com.power.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
*  管理员表实体类
*/

@Entity
@ApiModel(value="管理员")
@Data
@Table(name="Ha_manage")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Ha_mange.Ha_mangePK.class) 用于复合组件
public class ha_manage extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @Column(nullable = false)
    @ApiModelProperty(value = "用户id")
    private String userid;

    @Column(nullable = false)
    @ApiModelProperty(value = "管理员标识（3200:超级 ；3201普通）")
    private Integer owner;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("userid", this.getUserid());
        map.put("owner", this.getOwner());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Ha_mangePK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Ha_mangePK pk = (Ha_mangePK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}